<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <base href="${pageContext.request.contextPath}/"/>
    <title>襄阳蓝芯智能化办公系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="view/bootstrap-3.3.5/css/bootstrap.css"/>
    <style>
        /*定义类名为.thead-blue的样式*/
        .thead-blue {
            color: #fff;
            font-weight: bold;
            background-color: #337ab7;
        }
    </style>
</head>
<body>

<div class="panel panel-primary">
    <table class="table table-bordered table-hover">
        <thead>
        <tr class="thead-blue">
            <td colspan="4">报销申请单详情</td>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td class="col-md-2"><label>申请单号</label></td>
            <td class="col-md-4">${bx.docNo}</td>
            <td class="col-md-2"><label>审批流程</label></td>
            <td class="col-md-4">${bx.lcflow.flowName}</td>
        </tr>
        <tr>
            <td><label>创建人</label></td>
            <td>${bx.empcreator.empName}</td>
            <td><label>单据类型</label></td>
            <td>
                ${bx.docType=='BXD'?"报销申请单":"" }
                ${bx.docType=='GMD'?"资产购买申请单":"" }
                ${bx.docType=='YDD'?"资产移动申请单":"" }
            </td>

        </tr>
        <tr>
            <td><label>申请人</label></td>
            <td>${bx.empproposer.empName}</td>
            <td><label>申请时所在部门</label></td>
            <td>${bx.dept.deptName}</td>
        </tr>
        <tr>
            <td><label>申报金额</label></td>
            <td>${bx.applyAmount}</td>
            <td><label>实报金额</label></td>
            <td>${bx.bookAmount}</td>
        </tr>
        <tr>
            <td><label>创建时间</label></td>
            <td>
                ${bx.createDate}
            </td>
            <td><label>提交时间</label></td>
            <td>
                ${bx.submitDate}
            </td>
        </tr>
        <tr>
            <td><label>领款人</label></td>
            <td>${bx.emppayee.empName}</td>
            <td><label>领款登记人</label></td>
            <td>${bx.empbooker.empName}</td>
        </tr>
        <tr>
            <td><label>领款时间</label></td>
            <td>${bx.bookDate}</td>
            <td><label>单据状态</label></td>
            <td>
                <c:if test='${bx.status=="W" }'>
                    未提交
                </c:if>
                <c:if test='${bx.status=="S" }'>
                    审批中
                </c:if>
                <c:if test='${bx.status=="Y" }'>
                    审批通过
                </c:if>
                <c:if test='${bx.status=="N" }'>
                    审批不通过
                </c:if>
                <c:if test='${bx.status=="O" }'>
                    已领款
                </c:if>
            </td>
        </tr>
        <tr>
            <td><label>申请事由</label></td>
            <td colspan="3">${bx.reason}</td>
        </tr>
        <tr class="thead-blue">
            <td colspan="4">报销明细</td>
        </tr>

        <c:forEach items="${bx.maldetails}" var="m">
            <tr>
                <td><label>报销类型</label></td>
                <td>${m.bxtype.name}</td>
                <td><label>申报金额</label></td>
                <td>${m.applyAmount}</td>
            </tr>
            <tr>
                <td><label>实报金额</label></td>
                <td colspan="3">${m.amount}</td>
            </tr>
        </c:forEach>

        <tr class="thead-blue">
            <td colspan="4">附件</td>
        </tr>

        <c:forEach items="${bx.malaccessary}" var="a">
            <tr>
                <td><label>附件1</label></td>
                <td>
                    <input type="hidden" name="contentfile" value="${a.content}">
                    <A href="apply/downloadBxFile?oid=${a.oid}">${a.content}</A>
                </td>
                <td><label>附件描述</label></td>
                <td>${a.description}</td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="4" align="center">
                <a type="button" href="javascript:history.back()" class="btn btn-info">返回</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>


<script type="text/javascript">
    $(document).ajaxError(function (event, xhr) {
        if (xhr.status == "403") {//没有权限
            document.location.href = xhr.getResponseHeader("url");
        } else if (xhr.status != "200") {
            //alert("服务器错误!");
            console.log("服务器错误!");
        }
    });
</script>
</body>
</html>